import { defineStore } from 'pinia'

export const useTaskRuleStore = defineStore('taskEventStore', {
  state: () => {
    return {
      taskRules: [{
        taskRuleId: 1,
        ruleKey:'byUser',
        taskRuleName: "按指定的人员"
      },{
        taskRuleId: 2,
        ruleKey:'byPosition',
        taskRuleName: "按指定的岗位"
      }, {
        taskRuleId: 3,
        ruleKey:'byRole',
        taskRuleName: "按指定的角色"
      }, {
        taskRuleId: 4,
        ruleKey:'byDept',
        taskRuleName: "按指定的部门"
      }, {
        taskRuleId: 5,
        ruleKey:'byGroup',
        taskRuleName: "按照指定的分组"
      }, {
        taskRuleId: 6,
        ruleKey:'byDeptAndPosition',
        taskRuleName: "按照部门与岗位的交集查找"
      }, {
        taskRuleId: 7,
        ruleKey:'byDeptAndRole',
        taskRuleName: "按照部门与角色的交集查找"
      }, {
        taskRuleId: 8,
        ruleKey:'byTaskManager',
        taskRuleName: "某个任务处理人的部门负责人"
      }, {
        taskRuleId: 9,
        ruleKey:'byTaskLeader',
        taskRuleName: "某个任务处理人的分管领导"
      },  {
        taskRuleId: 10,
        ruleKey:'byManuallySelect',
        taskRuleName: "手工选择处理人"
      }, {
        taskRuleId: 11,
        ruleKey:'bySql',
        taskRuleName: "按照sql语句指定"
      }, {
        taskRuleId: 12,
        ruleKey:'byWebAPI',
        taskRuleName: "按照WebAPI指定"
      }, {
        taskRuleId: 13,
        ruleKey:'byParams',
        taskRuleName: "按照开发者参数指定"
      }, {
        taskRuleId: 14,
        ruleKey:'byNode',
        taskRuleName: "与指定的步骤处理人相同"
      }],
      returnWays: [{
        returnWayKey: 'none',
        returnWayName: "禁用"
      }, {
        returnWayKey: 'previousStep',
        returnWayName: "退回到上一步"
      }, {
        returnWayKey: 'allStepsTaken',
        returnWayName: "退回到历史步骤"
      }],
      jumpWays: [{
        jumpWayKey: 'none',
        jumpWayName: "禁用"
      }, {
        jumpWayKey: 'noUsers',
        jumpWayName: "没有找到处理人"
      },{
        jumpWayKey: 'satpStep',
        jumpWayName: "与上一步处理人相同"
      }, {
        jumpWayKey: 'appeared',
        jumpWayName: "处理人已审核过"
      }],
      ccWays: [{
        ccKey: 'none',
        ccName: "禁用"
      }, {
        ccKey: 'manualCC',
        ccName: "手动抄送"
      }, {
        ccKey: 'autoCC',
        ccName: "自动抄送"
      }],
      autoCCWays: [{
        autoCCKey: 'none',
        autoCCName: "禁用"
      }, {
        autoCCKey: 'byUsers',
        autoCCName: "抄送给指定的人员"
      }, {
        autoCCKey: 'byRoles',
        autoCCName: "抄送给指定的角色"
      }, {
        autoCCKey: 'byPositions',
        autoCCName: "抄送给指定的岗位"
      }],
      sexSelects: [{
        value: 0,
        label: "女"
      }, {
        value: 1,
        label: "男"
      }],
      userSatets: [{
        value: 0,
        label: "禁用"
      }, {
        value: 1,
        label: "启用"
      }],
      startRules:[
        {
          taskRuleId: 0,
          ruleKey:'byStarter',
          taskRuleName: "系统默认(第一个节点使用)"
        }
      ]
    }
  },
})
